package com.eportal.service.impl;

import javax.annotation.Resource;
import org.springframework.stereotype.Service;

import com.eportal.base.BaseDAO;
import com.eportal.domain.PayQrcode;
import com.eportal.exception.NotUniqueException;
import com.eportal.service.PayQrcodeService;

@Service("payQrcodeService")
public class PayQrcodeServiceImpl  implements PayQrcodeService{

	@Resource(name="dao")
	 private BaseDAO dao;

	@Override
	public void add(PayQrcode payQrcode) throws Exception {
		dao.save(payQrcode);
	}

	@Override
	public PayQrcode getByWid(Long wid) throws NotUniqueException {
		return (PayQrcode)dao.getUniqueFirst("from PayQrcode where wid='"+wid+"'");
	}
	
	public void update(PayQrcode payQrcode){
		dao.update(payQrcode);
	}

	@Override
	public PayQrcode get(Long sid) {
		
		return (PayQrcode)dao.getById(PayQrcode.class, sid);
	}
	
	
}
